import java.util.*;

/**
 * @author LKQ
 * @date 2022/6/14 12:16
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int cnt = 0;
            for (int i = 2; i <= n ; i++) {
                int ans = 1;
                for (int j = 2; j * j <= i; j++) {
                    if (i % j == 0 ) {
                        ans += j;
                        if (i / j != j) {
                            ans += i / j;
                        }
                    }
                }
                if (ans == i ) {
                    cnt++;
                }
            }
            System.out.println(cnt);
        }
    }
}
